<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <title>std.uri</title>
  <link href="./css/style.css" rel="stylesheet" type="text/css"/>
  <!-- <link href="./img/icon.png" rel="icon" type="image/png"/> -->
  <script type="text/javascript" src="./js/jquery.js"></script>
  <script type="text/javascript" src="./js/modules.js"></script>
  <script type="text/javascript" src="./js/quicksearch.js"></script>
  <script type="text/javascript" src="./js/navigation.js"></script>
  <!--<script type="text/javascript" src="./js/jquery.treeview.js"></script>-->
  <script type="text/javascript">
    var g_moduleFQN = "std.uri";
  </script>
  
</head>
<body>
<div id="content">
  <h1><a href="./htmlsrc/std.uri.html" class="symbol">std.uri</a></h1>
  
<div class="summary">Encode and decode Uniform Resource Identifiers (URIs).
 URIs are used in internet transfer protocols.
 Valid URI characters consist of letters, digits,
 and the characters <b>;/?:@&amp;=+$,-_.!~*'()</b>
 Reserved URI characters are <b>;/?:@&amp;=+$,</b>
 Escape sequences consist of <b>%</b> followed by two hex digits.</div>
<p class="sec_header">See Also:</p><a href="http://www.ietf.org/rfc/rfc3986.txt">RFC 3986</a><br>
  <a href="http://en.wikipedia.org/wiki/Uniform_resource_identifier">Wikipedia</a>
<dl>
<dt class="decl">class <a class="symbol _class" name="URIerror" href="./htmlsrc/std.uri.html#L53" kind="class" beg="53" end="59">URIerror</a> : Error; <a title="Permalink to this symbol" href="#URIerror" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.uri.html#L53">#</a></dt>
<dd class="ddef">
<dl>
<dt class="decl"><a class="symbol _ctor" name="URIerror.this" href="./htmlsrc/std.uri.html#L55" kind="ctor" beg="55" end="58">this</a><span class="params">()</span>; <a title="Permalink to this symbol" href="#URIerror.this" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.uri.html#L55">#</a></dt>
<dd class="ddef"></dd></dl></dd>
<dt class="decl"><a class="symbol _enum" name="enum" href="./htmlsrc/std.uri.html#L61" kind="enum" beg="61" end="68">enum</a>; <a title="Permalink to this symbol" href="#enum" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.uri.html#L61">#</a></dt>
<dd class="ddef">
<dl>
<dt class="decl"><a class="symbol _enummem" name="enum.URI_Alpha" href="./htmlsrc/std.uri.html#L63" kind="enummem" beg="63" end="63">URI_Alpha</a> <a title="Permalink to this symbol" href="#enum.URI_Alpha" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.uri.html#L63">#</a></dt>
<dd class="ddef"></dd>
<dt class="decl"><a class="symbol _enummem" name="enum.URI_Reserved" href="./htmlsrc/std.uri.html#L64" kind="enummem" beg="64" end="64">URI_Reserved</a> <a title="Permalink to this symbol" href="#enum.URI_Reserved" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.uri.html#L64">#</a></dt>
<dd class="ddef"></dd>
<dt class="decl"><a class="symbol _enummem" name="enum.URI_Mark" href="./htmlsrc/std.uri.html#L65" kind="enummem" beg="65" end="65">URI_Mark</a> <a title="Permalink to this symbol" href="#enum.URI_Mark" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.uri.html#L65">#</a></dt>
<dd class="ddef"></dd>
<dt class="decl"><a class="symbol _enummem" name="enum.URI_Digit" href="./htmlsrc/std.uri.html#L66" kind="enummem" beg="66" end="66">URI_Digit</a> <a title="Permalink to this symbol" href="#enum.URI_Digit" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.uri.html#L66">#</a></dt>
<dd class="ddef"></dd>
<dt class="decl"><a class="symbol _enummem" name="enum.URI_Hash" href="./htmlsrc/std.uri.html#L67" kind="enummem" beg="67" end="67">URI_Hash</a> <a title="Permalink to this symbol" href="#enum.URI_Hash" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.uri.html#L67">#</a></dt>
<dd class="ddef"></dd></dl></dd>
<dt class="decl">char[16] <a class="symbol _variable" name="hex2ascii" href="./htmlsrc/std.uri.html#L70" kind="variable" beg="70" end="70">hex2ascii</a>; <span class="attrs">[<span class="stc">invariant</span>]</span> <a title="Permalink to this symbol" href="#hex2ascii" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.uri.html#L70">#</a></dt>
<dd class="ddef"></dd>
<dt class="decl">ubyte[128] <a class="symbol _variable" name="uri_flags" href="./htmlsrc/std.uri.html#L72" kind="variable" beg="72" end="72">uri_flags</a>; <a title="Permalink to this symbol" href="#uri_flags" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.uri.html#L72">#</a></dt>
<dd class="ddef"></dd>
<dt class="decl">static <a class="symbol _sctor" name="this" href="./htmlsrc/std.uri.html#L74" kind="sctor" beg="74" end="94">this</a>(); <a title="Permalink to this symbol" href="#this" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.uri.html#L74">#</a></dt>
<dd class="ddef"></dd>
<dt class="decl">string <a class="symbol _function" name="URI_Encode" href="./htmlsrc/std.uri.html#L97" kind="function" beg="97" end="227">URI_Encode</a><span class="params">(dstring <em>string</em>, uint <em>unescapedSet</em>)</span>; <span class="attrs">[<span class="prot">private</span>]</span> <a title="Permalink to this symbol" href="#URI_Encode" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.uri.html#L97">#</a></dt>
<dd class="ddef"></dd>
<dt class="decl">uint <a class="symbol _function" name="ascii2hex" href="./htmlsrc/std.uri.html#L229" kind="function" beg="229" end="234">ascii2hex</a><span class="params">(dchar <em>c</em>)</span>; <a title="Permalink to this symbol" href="#ascii2hex" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.uri.html#L229">#</a></dt>
<dd class="ddef"></dd>
<dt class="decl">dstring <a class="symbol _function" name="URI_Decode" href="./htmlsrc/std.uri.html#L236" kind="function" beg="236" end="344">URI_Decode</a><span class="params">(string <em>string</em>, uint <em>reservedSet</em>)</span>; <span class="attrs">[<span class="prot">private</span>]</span> <a title="Permalink to this symbol" href="#URI_Decode" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.uri.html#L236">#</a></dt>
<dd class="ddef"></dd>
<dt class="decl">string <a class="symbol _function" name="decode" href="./htmlsrc/std.uri.html#L352" kind="function" beg="352" end="356">decode</a><span class="params">(string <em>encodedURI</em>)</span>; <a title="Permalink to this symbol" href="#decode" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.uri.html#L352">#</a></dt>
<dd class="ddef">
<div class="summary">Decodes the URI string encodedURI into a UTF-8 string and returns it.
 Escape sequences that resolve to reserved URI characters are not replaced.
 Escape sequences that resolve to the '#' character are not replaced.</div></dd>
<dt class="decl">string <a class="symbol _function" name="decodeComponent" href="./htmlsrc/std.uri.html#L363" kind="function" beg="363" end="367">decodeComponent</a><span class="params">(string <em>encodedURIComponent</em>)</span>; <a title="Permalink to this symbol" href="#decodeComponent" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.uri.html#L363">#</a></dt>
<dd class="ddef">
<div class="summary">Decodes the URI string encodedURI into a UTF-8 string and returns it. All
 escape sequences are decoded.</div></dd>
<dt class="decl">string <a class="symbol _function" name="encode" href="./htmlsrc/std.uri.html#L374" kind="function" beg="374" end="378">encode</a><span class="params">(string <em>uri</em>)</span>; <a title="Permalink to this symbol" href="#encode" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.uri.html#L374">#</a></dt>
<dd class="ddef">
<div class="summary">Encodes the UTF-8 string uri into a URI and returns that URI. Any character
 not a valid URI character is escaped. The '#' character is not escaped.</div></dd>
<dt class="decl">string <a class="symbol _function" name="encodeComponent" href="./htmlsrc/std.uri.html#L385" kind="function" beg="385" end="389">encodeComponent</a><span class="params">(string <em>uriComponent</em>)</span>; <a title="Permalink to this symbol" href="#encodeComponent" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.uri.html#L385">#</a></dt>
<dd class="ddef">
<div class="summary">Encodes the UTF-8 string uriComponent into a URI and returns that URI.
 Any character not a letter, digit, or one of -_.!~*'() is escaped.</div></dd>
<dt class="decl">size_t <a class="symbol _function" name="uriLength" href="./htmlsrc/std.uri.html#L398" kind="function" beg="398" end="447">uriLength</a><span class="params">(string <em>s</em>)</span>; <a title="Permalink to this symbol" href="#uriLength" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.uri.html#L398">#</a></dt>
<dd class="ddef">
<div class="summary">Does string s[] start with a URL?</div>
<p class="sec_header">Returns:</p>-1    it does not
  len  it does, and s[0..len] is the slice of s[] that is that URL</dd>
<dt class="decl">size_t <a class="symbol _function" name="emailLength" href="./htmlsrc/std.uri.html#L457" kind="function" beg="457" end="503">emailLength</a><span class="params">(string <em>s</em>)</span>; <a title="Permalink to this symbol" href="#emailLength" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.uri.html#L457">#</a></dt>
<dd class="ddef">
<div class="summary">Does string s[] start with an email address?</div>
<p class="sec_header">Returns:</p>-1    it does not
  len   it does, and s[0..i] is the slice of s[] that is that email address
<p class="sec_header">References:</p>RFC2822</dd>
<dt class="decl"><a class="symbol _unittest" name="unittest" href="./htmlsrc/std.uri.html#L506" kind="unittest" beg="506" end="535">unittest</a>; <a title="Permalink to this symbol" href="#unittest" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.uri.html#L506">#</a></dt>
<dd class="ddef"></dd></dl>
</div>
<div id="footer">
  <p>Copyright © 1999-2008 by Digital Mars ®, All Rights Reserved.</p>
  <p>Page generated by <a href="http://code.google.com/p/dil">dil</a> on Sun Dec 28 04:26:47 2008. Rendered by <a href="http://code.google.com/p/dil/wiki/Kandil">kandil</a>.</p>
</div>
</body>
</html>